//
//  ViewController.m
//  shareTest
//
//  Created by sxiaojian on 14/10/22.
//  Copyright (c) 2014年 com.sxiaojian. All rights reserved.
//

#import "ViewController.h"
#import "SocialCenter.h"
#import <FacebookSDK/FacebookSDK.h>
@interface ViewController ()
- (IBAction)requestFriends:(UIButton *)sender;

- (IBAction)clicked:(UIButton *)sender;
- (IBAction)share:(UIButton *)sender;
@property (strong, nonatomic) IBOutlet UILabel *loginLabel;
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    FBLoginView *loginView = [[FBLoginView alloc] init];
//    loginView.center = self.view.center;
//    [self.view addSubview:loginView];
    // Do any additional setup after loading the view, typically from a nib.
    //test
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)requestFriends:(UIButton *)sender {
   [SocialCenter getFriendshipsAtIndex:3 completionBlock:^(BOOL isSuccess, NSArray *array) {
       if (isSuccess) {
           NSLog(@"%@",array);
       }
   }];
}

- (IBAction)clicked:(UIButton *)sender {
    [SocialCenter loginindex:sender.tag Success:^(PlatformUserMoidel *model) {
        self.loginLabel.text = [NSString stringWithFormat:@"%@",model.orginalData];
        [self.loginLabel sizeToFit];
        self.scrollView.contentSize = self.loginLabel.frame.size;
    } error:nil];
}

- (IBAction)share:(UIButton *)sender {
    int tag = sender.tag;
  [SocialCenter  shareToPlayformWithIndex:tag andURL:@"www.baidu.com" andWithTitle:@"测试" andWithMessage:@"测试内容" andImageURL:@"http://www.baidu.com/img/bdlogo.png" andWithLocalImage:nil andBlock:^(BOOL isSuccess) {
      
  }];

    
}
@end
